home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: list.tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text, with CR line terminators
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[CR]
| default (weak)
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [ttxt] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 63 68 61 70 74 65 72 | 7b 4c 69 73 74 73 7d 0d |\chapter|{Lists}.|
|00000010| 5c 69 6e 64 65 78 7b 6c | 69 73 74 7c 28 7d 0d 0d |\index{l|ist|(}..|
|00000020| 54 68 69 73 20 63 68 61 | 70 74 65 72 20 61 73 73 |This cha|pter ass|
|00000030| 75 6d 65 73 20 6b 6e 6f | 77 6c 65 64 67 65 20 6f |umes kno|wledge o|
|00000040| 66 20 74 68 65 20 73 63 | 61 6c 61 72 2c 20 6d 61 |f the sc|alar, ma|
|00000050| 74 72 69 78 20 61 6e 64 | 20 73 74 72 69 6e 67 0d |trix and| string.|
|00000060| 76 61 72 69 61 62 6c 65 | 20 74 79 70 65 73 2e 20 |variable| types. |
|00000070| 20 41 20 6c 69 73 74 20 | 69 73 20 61 20 63 6f 6e | A list |is a con|
|00000080| 76 65 6e 69 65 6e 74 20 | 77 61 79 20 74 6f 20 67 |venient |way to g|
|00000090| 72 6f 75 70 20 74 6f 67 | 65 74 68 65 72 0d 64 69 |roup tog|ether.di|
|000000a0| 66 66 65 72 65 6e 74 20 | 74 79 70 65 73 20 6f 66 |fferent |types of|
|000000b0| 20 76 61 72 69 61 62 6c | 65 73 2c 20 61 6e 64 20 | variabl|es, and |
|000000c0| 74 72 65 61 74 20 74 68 | 65 6d 20 61 73 20 6f 6e |treat th|em as on|
|000000d0| 65 20 76 61 72 69 61 62 | 6c 65 2e 0d 54 68 69 73 |e variab|le..This|
|000000e0| 20 69 73 20 76 65 72 79 | 20 73 69 6d 69 6c 61 72 | is very| similar|
|000000f0| 20 74 6f 20 74 68 65 20 | 77 61 79 20 61 20 50 61 | to the |way a Pa|
|00000100| 73 63 61 6c 20 72 65 63 | 6f 72 64 2c 20 6f 72 20 |scal rec|ord, or |
|00000110| 43 20 73 74 72 75 63 74 | 75 72 65 20 69 73 0d 6d |C struct|ure is.m|
|00000120| 61 64 65 20 75 70 2e 0d | 0d 41 20 6e 69 63 65 20 |ade up..|.A nice |
|00000130| 74 68 69 6e 67 20 61 62 | 6f 75 74 20 6c 69 73 74 |thing ab|out list|
|00000140| 73 20 69 73 20 74 68 61 | 74 20 74 68 65 79 20 6f |s is tha|t they o|
|00000150| 6e 6c 79 20 63 6f 6e 74 | 61 69 6e 20 6f 62 6a 65 |nly cont|ain obje|
|00000160| 63 74 73 20 74 68 61 74 | 20 61 72 65 0d 65 78 70 |cts that| are.exp|
|00000170| 6c 69 63 69 74 6c 79 20 | 69 6e 73 74 61 6c 6c 65 |licitly |installe|
|00000180| 64 2c 20 72 65 67 61 72 | 64 6c 65 73 73 20 6f 66 |d, regar|dless of|
|00000190| 20 74 68 65 20 69 6e 64 | 65 78 20 76 61 6c 75 65 | the ind|ex value|
|000001a0| 73 2e 20 20 46 6f 72 20 | 69 6e 73 74 61 6e 63 65 |s. For |instance|
|000001b0| 2c 20 61 0d 6c 69 73 74 | 20 77 69 74 68 20 69 6e |, a.list| with in|
|000001c0| 64 65 78 20 76 61 6c 75 | 65 73 20 6f 66 20 5c 76 |dex valu|es of \v|
|000001d0| 65 72 62 2b 31 2b 20 61 | 6e 64 20 5c 76 65 72 62 |erb+1+ a|nd \verb|
|000001e0| 2b 31 30 30 2b 20 77 69 | 6c 6c 20 6f 6e 6c 79 20 |+100+ wi|ll only |
|000001f0| 63 6f 6e 74 61 69 6e 73 | 0d 74 77 6f 20 69 74 65 |contains|.two ite|
|00000200| 6d 73 2c 20 74 68 65 20 | 65 6c 65 6d 65 6e 74 73 |ms, the |elements|
|00000210| 20 66 6f 72 20 74 68 65 | 20 5c 76 65 72 62 2b 31 | for the| \verb+1|
|00000220| 2b 20 61 6e 64 20 5c 76 | 65 72 62 2b 31 30 30 2b |+ and \v|erb+100+|
|00000230| 20 69 6e 64 69 63 65 73 | 2c 20 6e 6f 0d 6d 6f 72 | indices|, no.mor|
|00000240| 65 2e 20 46 75 72 74 68 | 65 72 6d 6f 72 65 2c 20 |e. Furth|ermore, |
|00000250| 6c 69 73 74 73 20 63 61 | 6e 20 62 65 20 6d 6f 72 |lists ca|n be mor|
|00000260| 65 20 65 66 66 69 63 69 | 65 6e 74 20 74 68 61 6e |e effici|ent than|
|00000270| 20 61 70 70 65 6e 64 69 | 6e 67 20 72 6f 77 73 20 | appendi|ng rows |
|00000280| 6f 72 0d 63 6f 6c 75 6d | 6e 73 20 6f 6e 74 6f 20 |or.colum|ns onto |
|00000290| 6d 61 74 72 69 63 65 73 | 2c 20 73 69 6e 63 65 20 |matrices|, since |
|000002a0| 74 68 65 20 6d 65 6d 6f | 72 79 20 6d 61 6e 61 67 |the memo|ry manag|
|000002b0| 65 6d 65 6e 74 20 6f 76 | 65 72 68 65 61 64 20 69 |ement ov|erhead i|
|000002c0| 73 20 6c 65 73 73 2e 0d | 0d 4c 69 73 74 73 20 63 |s less..|.Lists c|
|000002d0| 61 6e 20 61 6c 73 6f 20 | 62 65 20 61 20 63 6f 6e |an also |be a con|
|000002e0| 76 65 6e 69 65 6e 74 20 | 77 61 79 20 74 6f 20 68 |venient |way to h|
|000002f0| 61 76 65 20 61 6e 20 61 | 72 72 61 79 20 74 68 61 |ave an a|rray tha|
|00000300| 74 20 69 6e 64 65 78 65 | 73 20 66 72 6f 6d 0d 7a |t indexe|s from.z|
|00000310| 65 72 6f 2e 20 54 68 69 | 73 20 6d 61 79 20 6e 6f |ero. Thi|s may no|
|00000320| 74 20 62 65 20 61 73 20 | 65 66 66 69 63 69 65 6e |t be as |efficien|
|00000330| 74 20 61 73 20 75 73 69 | 6e 67 20 61 20 6d 61 74 |t as usi|ng a mat|
|00000340| 72 69 78 2c 20 74 68 6f | 75 67 68 20 69 66 20 74 |rix, tho|ugh if t|
|00000350| 68 65 0d 70 72 6f 62 6c | 65 6d 20 69 73 20 65 78 |he.probl|em is ex|
|00000360| 70 72 65 73 73 65 64 20 | 6d 6f 72 65 20 63 6c 65 |pressed |more cle|
|00000370| 61 72 6c 79 2c 20 74 68 | 65 6e 20 61 20 6c 69 73 |arly, th|en a lis|
|00000380| 74 20 6d 61 79 20 62 65 | 20 61 70 70 72 6f 70 72 |t may be| appropr|
|00000390| 69 61 74 65 2e 0d 0d 5c | 73 65 63 74 69 6f 6e 7b |iate...\|section{|
|000003a0| 4c 69 73 74 20 43 72 65 | 61 74 69 6f 6e 7d 0d 5c |List Cre|ation}.\|
|000003b0| 69 6e 64 65 78 7b 6c 69 | 73 74 21 63 72 65 61 74 |index{li|st!creat|
|000003c0| 69 6f 6e 7c 28 7d 20 0d | 41 20 6c 69 73 74 20 63 |ion|(} .|A list c|
|000003d0| 61 6e 20 62 65 20 63 72 | 65 61 74 65 64 20 65 69 |an be cr|eated ei|
|000003e0| 74 68 65 72 20 65 78 70 | 6c 69 63 69 74 6c 79 20 |ther exp|licitly |
|000003f0| 6f 72 20 69 6d 70 6c 69 | 63 69 74 6c 79 2e 20 20 |or impli|citly. |
|00000400| 47 65 6e 65 72 61 6c 6c | 79 2c 20 79 6f 75 0d 77 |Generall|y, you.w|
|00000410| 69 6c 6c 20 75 73 65 20 | 74 68 65 20 69 6d 70 6c |ill use |the impl|
|00000420| 69 63 69 74 20 6d 65 74 | 68 6f 64 2c 20 62 75 74 |icit met|hod, but|
|00000430| 20 77 65 20 77 69 6c 6c | 20 6c 6f 6f 6b 20 61 74 | we will| look at|
|00000440| 20 62 6f 74 68 20 6d 65 | 74 68 6f 64 73 2e 20 41 | both me|thods. A|
|00000450| 6c 73 6f 2c 0d 6e 6f 74 | 65 20 74 68 61 74 20 74 |lso,.not|e that t|
|00000460| 68 65 20 74 77 6f 20 6d | 65 74 68 6f 64 73 20 61 |he two m|ethods a|
|00000470| 72 65 20 6e 6f 74 20 6d | 75 74 75 61 6c 6c 79 20 |re not m|utually |
|00000480| 65 78 63 6c 75 73 69 76 | 65 2e 20 20 49 6e 20 70 |exclusiv|e. In p|
|00000490| 61 72 74 69 63 75 6c 61 | 72 2c 0d 6e 6f 74 65 20 |articula|r,.note |
|000004a0| 74 68 61 74 20 69 74 20 | 69 73 20 71 75 69 74 65 |that it |is quite|
|000004b0| 20 6c 65 67 69 74 69 6d | 61 74 65 20 74 6f 20 63 | legitim|ate to c|
|000004c0| 72 65 61 74 65 20 61 20 | 6c 69 73 74 20 65 78 70 |reate a |list exp|
|000004d0| 6c 69 63 69 74 6c 79 2c | 20 74 68 65 6e 20 61 64 |licitly,| then ad|
|000004e0| 64 0d 6d 6f 72 65 20 65 | 6c 65 6d 65 6e 74 73 20 |d.more e|lements |
|000004f0| 69 6d 70 6c 69 63 69 74 | 6c 79 2e 0d 0d 5c 73 75 |implicit|ly...\su|
|00000500| 62 73 65 63 74 69 6f 6e | 7b 45 78 70 6c 69 63 69 |bsection|{Explici|
|00000510| 74 20 43 72 65 61 74 69 | 6f 6e 7d 0d 0d 43 72 65 |t Creati|on}..Cre|
|00000520| 61 74 69 6e 67 20 61 20 | 6c 69 73 74 20 65 78 70 |ating a |list exp|
|00000530| 6c 69 63 69 74 6c 79 20 | 69 73 20 63 6f 6d 6d 6f |licitly |is commo|
|00000540| 6e 20 69 73 20 75 73 65 | 72 20 64 65 66 69 6e 65 |n is use|r define|
|00000550| 64 20 66 75 6e 63 74 69 | 6f 6e 73 0d 28 63 6f 76 |d functi|ons.(cov|
|00000560| 65 72 65 64 20 69 6e 20 | 74 68 65 20 6e 65 78 74 |ered in |the next|
|00000570| 20 63 68 61 70 74 65 72 | 29 2c 20 77 68 65 72 65 | chapter|), where|
|00000580| 20 79 6f 75 20 63 61 6c | 63 75 6c 61 74 65 20 74 | you cal|culate t|
|00000590| 68 65 20 76 61 72 69 6f | 75 73 0d 72 65 73 75 6c |he vario|us.resul|
|000005a0| 74 73 2c 20 74 68 65 6e | 20 6d 61 6b 65 20 61 20 |ts, then| make a |
|000005b0| 6c 69 73 74 20 74 68 61 | 74 20 63 6f 6e 74 61 69 |list tha|t contai|
|000005c0| 6e 69 6e 67 20 74 68 65 | 6d 2e 0d 0d 54 68 65 20 |ning the|m...The |
|000005d0| 65 78 70 6c 69 63 69 74 | 20 6c 69 73 74 20 63 72 |explicit| list cr|
|000005e0| 65 61 74 69 6f 6e 20 6f | 70 65 72 61 74 6f 72 73 |eation o|perators|
|000005f0| 20 61 72 65 20 5c 76 65 | 72 62 2b 3c 3c 2b 20 61 | are \ve|rb+<<+ a|
|00000600| 6e 64 20 5c 76 65 72 62 | 2b 3e 3e 2b 2e 20 20 54 |nd \verb|+>>+. T|
|00000610| 68 65 0d 6d 6f 73 74 20 | 62 61 73 69 63 20 6f 70 |he.most |basic op|
|00000620| 65 72 61 74 69 6f 6e 20 | 69 73 20 74 6f 20 63 72 |eration |is to cr|
|00000630| 65 61 74 65 20 61 6e 20 | 65 6d 70 74 79 20 6c 69 |eate an |empty li|
|00000640| 73 74 2e 20 48 65 72 65 | 20 69 73 20 61 6e 20 65 |st. Here| is an e|
|00000650| 78 61 6d 70 6c 65 20 6f | 66 0d 63 72 65 61 74 69 |xample o|f.creati|
|00000660| 6e 67 20 61 20 6c 69 73 | 74 20 28 63 61 6c 6c 65 |ng a lis|t (calle|
|00000670| 64 20 5c 76 65 72 62 2b | 6d 79 6c 69 73 74 2b 29 |d \verb+|mylist+)|
|00000680| 2c 20 77 69 74 68 20 6e | 6f 20 65 6c 65 6d 65 6e |, with n|o elemen|
|00000690| 74 73 3a 0d 5c 62 65 67 | 69 6e 7b 76 65 72 62 61 |ts:.\beg|in{verba|
|000006a0| 74 69 6d 7d 0d 3e 20 20 | 6d 79 6c 69 73 74 20 3d |tim}.> |mylist =|
|000006b0| 20 3c 3c 20 3e 3e 0d 20 | 20 20 20 20 20 20 20 3c | << >>. | <|
|000006c0| 3c 3e 3e 0d 5c 65 6e 64 | 7b 76 65 72 62 61 74 69 |<>>.\end|{verbati|
|000006d0| 6d 7d 0d 0d 4d 6f 72 65 | 20 75 73 65 66 75 6c 20 |m}..More| useful |
|000006e0| 69 73 20 63 72 65 61 74 | 69 6e 67 20 61 20 6c 69 |is creat|ing a li|
|000006f0| 73 74 20 77 69 74 68 20 | 73 6f 6d 65 20 65 6c 65 |st with |some ele|
|00000700| 6d 65 6e 74 73 20 61 6c | 72 65 61 64 79 20 69 6e |ments al|ready in|
|00000710| 20 69 74 2e 20 59 6f 75 | 0d 75 73 65 20 74 68 65 | it. You|.use the|
|00000720| 20 73 61 6d 65 20 6f 70 | 65 72 61 74 6f 72 73 2c | same op|erators,|
|00000730| 20 77 69 74 68 20 74 68 | 65 20 6e 61 6d 65 73 20 | with th|e names |
|00000740| 6f 66 20 74 68 65 20 76 | 61 72 69 61 62 6c 65 73 |of the v|ariables|
|00000750| 20 79 6f 75 20 77 61 6e | 74 20 74 6f 0d 70 75 74 | you wan|t to.put|
|00000760| 20 69 6e 74 6f 20 74 68 | 65 20 6c 69 73 74 20 77 | into th|e list w|
|00000770| 69 74 68 69 6e 20 74 68 | 65 20 74 68 65 20 6c 69 |ithin th|e the li|
|00000780| 73 74 20 6f 70 65 72 61 | 74 6f 72 73 2e 20 20 41 |st opera|tors. A|
|00000790| 20 73 65 6d 69 63 6f 6c | 6f 6e 20 73 68 6f 75 6c | semicol|on shoul|
|000007a0| 64 0d 62 65 20 75 73 65 | 64 20 74 6f 20 73 65 70 |d.be use|d to sep|
|000007b0| 65 72 61 74 65 20 74 68 | 65 20 76 61 72 69 61 62 |erate th|e variab|
|000007c0| 6c 65 73 2e 20 20 48 65 | 72 65 20 69 73 20 61 6e |les. He|re is an|
|000007d0| 20 65 78 61 6d 70 6c 65 | 3a 0d 5c 62 65 67 69 6e | example|:.\begin|
|000007e0| 7b 76 65 72 62 61 74 69 | 6d 7d 0d 3e 20 61 20 3d |{verbati|m}.> a =|
|000007f0| 20 22 61 20 73 74 72 69 | 6e 67 22 0d 61 20 73 74 | "a stri|ng".a st|
|00000800| 72 69 6e 67 0d 3e 20 62 | 20 3d 20 32 33 2e 35 0d |ring.> b| = 23.5.|
|00000810| 20 62 20 3d 0d 20 20 20 | 20 20 32 33 2e 35 0d 3e | b =. | 23.5.>|
|00000820| 20 63 20 3d 20 72 61 6e | 64 28 32 2c 32 29 0d 20 | c = ran|d(2,2). |
|00000830| 63 20 3d 0d 20 20 20 20 | 20 20 20 20 31 20 20 20 |c =. | 1 |
|00000840| 20 20 20 30 2e 36 34 37 | 20 20 0d 20 20 20 20 30 | 0.647| . 0|
|00000850| 2e 39 37 35 20 20 20 20 | 20 20 30 2e 33 33 33 20 |.975 | 0.333 |
|00000860| 20 0d 3e 20 68 65 74 65 | 72 6f 67 65 6e 6f 75 73 | .> hete|rogenous|
|00000870| 20 3d 20 3c 3c 20 61 20 | 3b 20 62 20 3b 20 63 20 | = << a |; b ; c |
|00000880| 3e 3e 0d 20 20 20 31 20 | 20 20 20 20 20 20 20 20 |>>. 1 | |
|00000890| 20 20 20 32 20 20 20 20 | 20 20 20 20 20 20 20 20 | 2 | |
|000008a0| 33 20 20 20 20 20 0d 5c | 65 6e 64 7b 76 65 72 62 |3 .\|end{verb|
|000008b0| 61 74 69 6d 7d 0d 0d 4e | 6f 74 69 63 65 20 68 6f |atim}..N|otice ho|
|000008c0| 77 20 74 68 65 20 76 61 | 72 69 61 62 6c 65 73 20 |w the va|riables |
|000008d0| 61 72 65 20 69 6e 64 65 | 78 65 64 20 75 73 69 6e |are inde|xed usin|
|000008e0| 67 20 73 63 61 6c 61 72 | 73 2e 20 20 49 6e 64 65 |g scalar|s. Inde|
|000008f0| 78 69 6e 67 20 77 69 6c | 6c 20 62 65 0d 64 69 73 |xing wil|l be.dis|
|00000900| 63 75 73 73 65 64 20 6c | 61 74 65 72 2c 20 62 75 |cussed l|ater, bu|
|00000910| 74 20 73 75 66 66 69 63 | 65 20 66 6f 72 20 6e 6f |t suffic|e for no|
|00000920| 77 20 74 6f 20 73 61 79 | 20 74 68 61 74 20 74 68 |w to say| that th|
|00000930| 65 20 69 6e 64 65 78 20 | 69 73 20 68 6f 77 20 79 |e index |is how y|
|00000940| 6f 75 0d 67 65 74 20 74 | 68 65 20 69 6e 64 75 76 |ou.get t|he induv|
|00000950| 69 64 75 61 6c 20 65 6c | 65 6d 65 6e 74 73 20 62 |idual el|ements b|
|00000960| 61 63 6b 20 6f 75 74 20 | 6f 66 20 74 68 65 20 6c |ack out |of the l|
|00000970| 69 73 74 2e 20 20 54 68 | 65 20 69 6e 64 65 78 20 |ist. Th|e index |
|00000980| 69 73 20 6f 66 74 65 6e | 0d 6d 6f 72 65 20 75 73 |is often|.more us|
|00000990| 65 66 75 6c 20 69 66 20 | 79 6f 75 20 75 73 65 20 |eful if |you use |
|000009a0| 73 74 72 69 6e 67 73 20 | 74 68 61 74 20 61 64 64 |strings |that add|
|000009b0| 20 73 6f 6d 65 20 6d 65 | 61 6e 69 6e 67 20 74 6f | some me|aning to|
|000009c0| 20 74 68 65 20 76 61 6c | 75 65 73 0d 63 6f 6e 74 | the val|ues.cont|
|000009d0| 61 69 6e 65 64 20 77 69 | 74 68 69 6e 20 74 68 65 |ained wi|thin the|
|000009e0| 20 6c 69 73 74 2e 20 20 | 59 6f 75 20 64 6f 20 74 | list. |You do t|
|000009f0| 68 69 73 20 62 79 20 61 | 73 73 69 67 6e 69 6e 67 |his by a|ssigning|
|00000a00| 20 74 68 65 20 76 61 6c | 75 65 73 20 74 6f 20 61 | the val|ues to a|
|00000a10| 0d 73 74 72 69 6e 67 20 | 6c 61 62 65 6c 2c 20 61 |.string |label, a|
|00000a20| 73 20 73 68 6f 77 6e 20 | 68 65 72 65 3a 0d 0d 5c |s shown |here:..\|
|00000a30| 62 65 67 69 6e 7b 76 65 | 72 62 61 74 69 6d 7d 0d |begin{ve|rbatim}.|
|00000a40| 3e 20 61 20 3d 20 22 61 | 20 73 74 72 69 6e 67 22 |> a = "a| string"|
|00000a50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000a60| 0d 61 20 73 74 72 69 6e | 67 0d 3e 20 62 20 3d 20 |.a strin|g.> b = |
|00000a70| 32 33 2e 35 20 20 20 20 | 20 20 20 20 20 20 20 20 |23.5 | |
|00000a80| 20 20 20 20 20 20 20 20 | 20 20 0d 20 62 20 3d 0d | | . b =.|
|00000a90| 20 20 20 20 20 32 33 2e | 35 0d 3e 20 68 65 74 65 | 23.|5.> hete|
|00000aa0| 72 6f 67 65 6e 6f 75 73 | 32 20 3d 20 3c 3c 20 53 |rogenous|2 = << S|
|00000ab0| 74 72 69 6e 67 3d 61 20 | 3b 20 57 65 69 67 68 74 |tring=a |; Weight|
|00000ac0| 3d 62 20 3b 20 50 72 6f | 64 75 63 74 3d 72 61 6e |=b ; Pro|duct=ran|
|00000ad0| 64 28 33 2c 33 29 20 3e | 3e 0d 20 20 20 50 72 6f |d(3,3) >|>. Pro|
|00000ae0| 64 75 63 74 20 20 20 20 | 20 20 53 74 72 69 6e 67 |duct | String|
|00000af0| 20 20 20 20 20 20 20 57 | 65 69 67 68 74 0d 5c 65 | W|eight.\e|
|00000b00| 6e 64 7b 76 65 72 62 61 | 74 69 6d 7d 0d 0d 54 68 |nd{verba|tim}..Th|
|00000b10| 65 20 6c 61 62 65 6c 73 | 20 77 69 74 68 69 6e 20 |e labels| within |
|00000b20| 61 20 6c 69 73 74 20 61 | 72 65 20 6f 6e 6c 79 20 |a list a|re only |
|00000b30| 76 69 73 69 62 6c 65 20 | 69 6e 20 72 65 6c 61 74 |visible |in relat|
|00000b40| 69 6f 6e 20 74 6f 20 74 | 68 61 74 20 6c 69 73 74 |ion to t|hat list|
|00000b50| 2e 0d 54 68 61 74 20 69 | 73 2c 20 74 68 65 79 20 |..That i|s, they |
|00000b60| 64 6f 6e 27 74 20 61 70 | 70 65 61 72 20 69 6e 20 |don't ap|pear in |
|00000b70| 74 68 65 20 67 6c 6f 62 | 61 6c 20 73 79 6d 62 6f |the glob|al symbo|
|00000b80| 6c 20 74 61 62 6c 65 2e | 20 20 41 6c 73 6f 2c 20 |l table.| Also, |
|00000b90| 6e 6f 74 65 0d 74 68 61 | 74 20 74 68 65 20 76 61 |note.tha|t the va|
|00000ba0| 6c 75 65 73 20 74 68 61 | 74 20 61 72 65 20 62 65 |lues tha|t are be|
|00000bb0| 69 6e 67 20 63 6f 70 69 | 65 64 20 69 6e 74 6f 20 |ing copi|ed into |
|00000bc0| 74 68 65 20 6c 69 73 74 | 20 64 6f 20 6e 6f 74 0d |the list| do not.|
|00000bd0| 6e 65 63 63 65 73 73 61 | 72 69 6c 79 20 68 61 76 |neccessa|rily hav|
|00000be0| 65 20 74 6f 20 65 78 69 | 73 74 20 62 65 66 6f 72 |e to exi|st befor|
|00000bf0| 65 20 74 68 65 20 6c 69 | 73 74 20 69 73 20 63 72 |e the li|st is cr|
|00000c00| 65 61 74 65 64 2e 20 20 | 54 68 65 20 65 78 61 6d |eated. |The exam|
|00000c10| 70 6c 65 0d 61 62 6f 76 | 65 20 73 68 6f 77 73 20 |ple.abov|e shows |
|00000c20| 74 68 61 74 20 79 6f 75 | 20 63 61 6e 20 63 72 65 |that you| can cre|
|00000c30| 61 74 65 20 74 68 65 20 | 63 6f 6e 74 65 6e 74 73 |ate the |contents|
|00000c40| 20 61 74 20 74 68 65 20 | 73 61 6d 65 20 74 69 6d | at the |same tim|
|00000c50| 65 20 74 68 69 73 0d 6c | 69 73 74 20 69 73 20 63 |e this.l|ist is c|
|00000c60| 72 65 61 74 65 64 2e 20 | 20 20 0d 0d 5c 73 75 62 |reated. | ..\sub|
|00000c70| 73 65 63 74 69 6f 6e 7b | 49 6d 70 6c 69 63 69 74 |section{|Implicit|
|00000c80| 20 43 72 65 61 74 69 6f | 6e 7d 0d 0d 49 6d 70 6c | Creatio|n}..Impl|
|00000c90| 69 63 69 74 20 63 72 65 | 61 74 69 6f 6e 20 69 73 |icit cre|ation is|
|00000ca0| 20 6d 6f 73 74 20 63 6f | 6d 6d 6f 6e 6c 79 20 75 | most co|mmonly u|
|00000cb0| 73 65 64 20 61 74 20 74 | 68 65 20 63 6f 6d 6d 61 |sed at t|he comma|
|00000cc0| 6e 64 20 6c 69 6e 65 2c | 20 61 73 20 69 74 20 69 |nd line,| as it i|
|00000cd0| 73 0d 65 61 73 69 65 72 | 20 61 6e 64 20 74 61 6b |s.easier| and tak|
|00000ce0| 65 73 20 6c 65 73 73 20 | 66 6f 72 77 61 72 64 20 |es less |forward |
|00000cf0| 70 6c 61 6e 6e 69 6e 67 | 2e 20 20 54 68 65 20 62 |planning|. The b|
|00000d00| 61 73 69 63 20 69 64 65 | 61 20 69 73 20 74 68 61 |asic ide|a is tha|
|00000d10| 74 20 79 6f 75 0d 63 61 | 6e 20 6a 75 73 74 20 61 |t you.ca|n just a|
|00000d20| 64 64 20 61 6e 20 65 6c | 65 6d 65 6e 74 20 74 6f |dd an el|ement to|
|00000d30| 20 61 20 6c 69 73 74 20 | 77 69 74 68 6f 75 74 20 | a list |without |
|00000d40| 72 65 67 61 72 64 20 74 | 6f 20 77 68 65 74 68 65 |regard t|o whethe|
|00000d50| 72 20 74 68 61 74 20 6c | 69 73 74 0d 61 63 74 75 |r that l|ist.actu|
|00000d60| 61 6c 6c 79 20 65 78 69 | 73 74 73 2e 20 20 20 49 |ally exi|sts. I|
|00000d70| 66 20 74 68 65 20 6c 69 | 73 74 20 64 6f 65 73 6e |f the li|st doesn|
|00000d80| 27 74 20 65 78 69 73 74 | 2c 20 69 74 20 77 69 6c |'t exist|, it wil|
|00000d90| 6c 20 62 65 20 63 72 65 | 61 74 65 64 2c 20 61 6e |l be cre|ated, an|
|00000da0| 64 0d 74 68 65 6e 20 74 | 68 65 20 65 6c 65 6d 65 |d.then t|he eleme|
|00000db0| 6e 74 20 77 69 6c 6c 20 | 62 65 20 61 64 64 65 64 |nt will |be added|
|00000dc0| 2e 0d 0d 4c 65 74 27 73 | 20 6c 6f 6f 6b 20 61 74 |...Let's| look at|
|00000dd0| 20 61 6e 20 65 78 61 6d | 70 6c 65 3a 0d 5c 62 65 | an exam|ple:.\be|
|00000de0| 67 69 6e 7b 76 65 72 62 | 61 74 69 6d 7d 0d 3e 20 |gin{verb|atim}.> |
|00000df0| 77 68 6f 28 29 0d 65 70 | 73 20 20 70 69 20 20 20 |who().ep|s pi |
|00000e00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 0d | | .|
|00000e10| 3e 20 6d 79 6c 69 73 74 | 2e 76 65 63 74 20 3d 20 |> mylist|.vect = |
|00000e20| 31 3a 35 0d 20 20 20 76 | 65 63 74 20 20 20 20 20 |1:5. v|ect |
|00000e30| 20 20 20 20 0d 3e 20 6d | 79 6c 69 73 74 2e 6d 20 | .> m|ylist.m |
|00000e40| 3d 20 72 61 6e 64 28 32 | 2c 33 29 0d 20 20 20 6d |= rand(2|,3). m|
|00000e50| 20 20 20 20 20 20 20 20 | 20 20 20 20 76 65 63 74 | | vect|
|00000e60| 20 20 20 20 20 20 20 20 | 20 0d 3e 20 6d 79 6c 69 | | .> myli|
|00000e70| 73 74 2e 73 74 72 69 6e | 67 76 61 6c 20 3d 20 22 |st.strin|gval = "|
|00000e80| 6f 6e 65 20 70 6f 69 6e | 74 20 66 6f 75 72 20 74 |one poin|t four t|
|00000e90| 77 6f 22 0d 20 20 20 6d | 20 20 20 20 20 20 20 20 |wo". m| |
|00000ea0| 20 20 20 20 73 74 72 69 | 6e 67 76 61 6c 20 20 20 | stri|ngval |
|00000eb0| 20 76 65 63 74 20 20 0d | 5c 65 6e 64 7b 76 65 72 | vect .|\end{ver|
|00000ec0| 62 61 74 69 6d 7d 0d 0d | 49 6e 20 74 68 65 20 65 |batim}..|In the e|
|00000ed0| 78 70 6c 69 63 69 74 20 | 6d 65 74 68 6f 64 2c 20 |xplicit |method, |
|00000ee0| 77 65 20 73 61 77 20 68 | 6f 77 20 69 74 20 77 61 |we saw h|ow it wa|
|00000ef0| 73 20 70 6f 73 73 69 62 | 6c 65 20 74 6f 20 61 73 |s possib|le to as|
|00000f00| 73 69 67 6e 20 65 6c 65 | 6d 65 6e 74 73 0d 77 69 |sign ele|ments.wi|
|00000f10| 74 68 6f 75 74 20 69 6e | 64 69 63 69 65 73 2c 20 |thout in|dicies, |
|00000f20| 61 6e 64 20 68 61 76 65 | 20 5c 52 4c 61 42 5c 20 |and have| \RLaB\ |
|00000f30| 73 75 70 70 6c 79 20 73 | 63 61 6c 61 72 20 69 6e |supply s|calar in|
|00000f40| 64 69 63 69 65 73 0d 61 | 75 74 6f 6d 61 74 69 63 |dicies.a|utomatic|
|00000f50| 61 6c 6c 79 2e 20 54 68 | 65 72 65 20 69 73 6e 27 |ally. Th|ere isn'|
|00000f60| 74 20 61 6e 79 20 77 61 | 79 20 74 6f 20 64 6f 20 |t any wa|y to do |
|00000f70| 74 68 69 73 20 77 69 74 | 68 20 74 68 65 20 69 6d |this wit|h the im|
|00000f80| 70 6c 69 63 69 74 20 6c | 69 73 74 0d 63 72 65 61 |plicit l|ist.crea|
|00000f90| 74 69 6f 6e 20 6d 65 74 | 68 6f 64 2c 20 68 6f 77 |tion met|hod, how|
|00000fa0| 65 76 65 72 20 69 74 20 | 69 73 20 70 6f 73 73 69 |ever it |is possi|
|00000fb0| 62 6c 65 20 74 6f 20 67 | 65 74 20 73 63 61 6c 61 |ble to g|et scala|
|00000fc0| 72 20 69 6e 64 69 63 69 | 65 73 20 69 66 20 79 6f |r indici|es if yo|
|00000fd0| 75 0d 77 61 6e 74 20 74 | 68 65 6d 2e 20 20 54 6f |u.want t|hem. To|
|00000fe0| 20 64 6f 20 73 6f 2c 20 | 79 6f 75 20 68 61 76 65 | do so, |you have|
|00000ff0| 20 74 6f 20 75 73 65 20 | 73 71 75 61 72 65 20 62 | to use |square b|
|00001000| 72 61 63 65 73 2c 20 5c | 76 65 72 62 2b 5b 2b 20 |races, \|verb+[+ |
|00001010| 61 6e 64 0d 5c 76 65 72 | 62 2b 5d 2b 2c 20 61 72 |and.\ver|b+]+, ar|
|00001020| 6f 75 6e 64 20 74 68 65 | 20 73 63 61 6c 61 72 20 |ound the| scalar |
|00001030| 69 6e 64 65 78 2e 20 43 | 61 72 72 79 69 6e 67 20 |index. C|arrying |
|00001040| 6f 6e 20 66 72 6f 6d 20 | 74 68 65 20 70 72 65 76 |on from |the prev|
|00001050| 69 6f 75 73 0d 65 78 61 | 6d 70 6c 65 2c 20 69 66 |ious.exa|mple, if|
|00001060| 20 79 6f 75 20 77 61 6e | 74 20 61 6e 6f 74 68 65 | you wan|t anothe|
|00001070| 72 20 65 6c 65 6d 65 6e | 74 20 77 69 74 68 20 74 |r elemen|t with t|
|00001080| 68 65 20 73 63 61 6c 61 | 72 20 69 6e 64 65 78 20 |he scala|r index |
|00001090| 5c 76 65 72 62 2b 35 2b | 2c 0d 79 6f 75 20 77 6f |\verb+5+|,.you wo|
|000010a0| 75 6c 64 20 64 6f 20 74 | 68 65 20 66 6f 6c 6c 6f |uld do t|he follo|
|000010b0| 77 69 6e 67 2e 0d 0d 5c | 62 65 67 69 6e 7b 76 65 |wing...\|begin{ve|
|000010c0| 72 62 61 74 69 6d 7d 0d | 3e 20 6d 79 6c 69 73 74 |rbatim}.|> mylist|
|000010d0| 2e 5b 35 5d 20 3d 20 34 | 3a 36 3a 30 2e 35 0d 20 |.[5] = 4|:6:0.5. |
|000010e0| 20 20 35 20 20 20 20 20 | 20 20 20 20 20 20 20 6d | 5 | m|
|000010f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 73 74 72 69 | | stri|
|00001100| 6e 67 76 61 6c 20 20 20 | 20 76 65 63 74 0d 5c 65 |ngval | vect.\e|
|00001110| 6e 64 7b 76 65 72 62 61 | 74 69 6d 7d 0d 0d 48 6f |nd{verba|tim}..Ho|
|00001120| 77 65 76 65 72 20 74 68 | 65 20 62 72 61 63 65 73 |wever th|e braces|
|00001130| 20 61 72 65 20 67 6f 6f | 64 20 66 6f 72 20 6d 75 | are goo|d for mu|
|00001140| 63 68 20 6d 6f 72 65 20 | 74 68 61 6e 20 73 69 6d |ch more |than sim|
|00001150| 70 6c 65 20 73 63 61 6c | 61 72 0d 61 73 73 69 67 |ple scal|ar.assig|
|00001160| 6e 6d 65 6e 74 2e 20 20 | 54 68 6f 73 65 20 62 72 |nment. |Those br|
|00001170| 61 63 65 73 20 61 72 65 | 20 61 63 74 75 61 6c 6c |aces are| actuall|
|00001180| 79 20 66 6f 72 63 69 6e | 67 20 65 76 61 6c 75 61 |y forcin|g evalua|
|00001190| 74 69 6f 6e 20 6f 66 20 | 74 68 65 69 72 0d 63 6f |tion of |their.co|
|000011a0| 6e 74 65 6e 74 73 2c 20 | 61 6e 64 20 74 68 65 6e |ntents, |and then|
|000011b0| 20 63 6f 6e 76 65 72 74 | 20 74 68 65 20 72 65 73 | convert| the res|
|000011c0| 75 6c 74 20 74 6f 20 61 | 20 73 74 72 69 6e 67 2e |ult to a| string.|
|000011d0| 20 4e 6f 77 20 65 76 61 | 6c 75 61 74 69 6f 6e 20 | Now eva|luation |
|000011e0| 6f 66 20 61 0d 73 63 61 | 6c 61 72 20 63 6f 6e 73 |of a.sca|lar cons|
|000011f0| 74 61 6e 74 20 69 73 20 | 70 72 65 74 74 79 20 73 |tant is |pretty s|
|00001200| 69 6d 70 6c 65 2c 20 62 | 75 74 20 68 65 72 65 20 |imple, b|ut here |
|00001210| 61 72 65 20 6d 6f 72 65 | 20 63 6f 6d 70 6c 65 78 |are more| complex|
|00001220| 20 65 78 61 6d 70 6c 65 | 73 2c 0d 61 67 61 69 6e | example|s,.again|
|00001230| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 6f 6e 20 66 72 | followi|ng on fr|
|00001240| 6f 6d 20 70 72 65 76 69 | 6f 75 73 20 65 78 61 6d |om previ|ous exam|
|00001250| 70 6c 65 73 3a 0d 5c 62 | 65 67 69 6e 7b 76 65 72 |ples:.\b|egin{ver|
|00001260| 62 61 74 69 6d 7d 0d 3e | 20 65 3d 35 20 0d 20 65 |batim}.>| e=5 . e|
|00001270| 20 3d 0d 20 20 20 20 20 | 20 20 20 35 0d 3e 20 6d | =. | 5.> m|
|00001280| 79 6c 69 73 74 2e 5b 65 | 2b 73 71 72 74 28 34 29 |ylist.[e|+sqrt(4)|
|00001290| 5d 20 3d 20 34 2e 35 36 | 0d 20 20 20 35 20 20 20 |] = 4.56|. 5 |
|000012a0| 20 20 20 20 20 20 20 20 | 20 37 20 20 20 20 20 20 | | 7 |
|000012b0| 20 20 20 20 20 20 6d 20 | 20 20 20 20 20 20 20 20 | m | |
|000012c0| 20 20 20 73 74 72 69 6e | 67 76 61 6c 20 20 20 20 | strin|gval |
|000012d0| 76 65 63 74 0d 3e 20 73 | 74 72 69 6e 67 6d 61 74 |vect.> s|tringmat|
|000012e0| 20 3d 20 5b 20 22 73 74 | 72 69 6e 67 31 22 3b 20 | = [ "st|ring1"; |
|000012f0| 22 73 74 72 69 6e 67 32 | 22 20 3b 20 22 73 74 72 |"string2|" ; "str|
|00001300| 69 6e 67 33 22 20 5d 20 | 0d 20 73 74 72 69 6e 67 |ing3" ] |. string|
|00001310| 6d 61 74 20 3d 0d 73 74 | 72 69 6e 67 31 20 20 0d |mat =.st|ring1 .|
|00001320| 73 74 72 69 6e 67 32 20 | 20 0d 73 74 72 69 6e 67 |string2 | .string|
|00001330| 33 20 20 0d 3e 20 6d 79 | 6c 69 73 74 2e 5b 73 74 |3 .> my|list.[st|
|00001340| 72 69 6e 67 6d 61 74 5b | 32 5d 5d 20 3d 20 22 20 |ringmat[|2]] = " |
|00001350| 6d 6f 72 65 20 63 68 61 | 72 61 63 74 65 72 73 22 |more cha|racters"|
|00001360| 20 20 20 20 20 20 0d 20 | 20 20 35 20 20 20 20 20 | . | 5 |
|00001370| 20 20 20 20 20 20 20 37 | 20 20 20 20 20 20 20 20 | 7| |
|00001380| 20 20 20 20 6d 20 20 20 | 20 20 20 20 20 20 20 20 | m | |
|00001390| 20 73 74 72 69 6e 67 32 | 20 20 20 20 20 20 73 74 | string2| st|
|000013a0| 72 69 6e 67 76 61 6c 20 | 20 20 20 0d 20 20 20 76 |ringval | . v|
|000013b0| 65 63 74 20 20 20 20 20 | 20 20 20 20 0d 5c 65 6e |ect | .\en|
|000013c0| 64 7b 76 65 72 62 61 74 | 69 6d 7d 0d 0d 41 6c 74 |d{verbat|im}..Alt|
|000013d0| 68 6f 75 67 68 20 74 68 | 65 72 65 20 69 73 20 63 |hough th|ere is c|
|000013e0| 6f 6e 73 69 64 65 72 61 | 62 6c 65 20 70 6f 77 65 |onsidera|ble powe|
|000013f0| 72 20 69 6e 20 75 73 69 | 6e 67 20 73 63 61 6c 61 |r in usi|ng scala|
|00001400| 72 20 69 6e 64 69 63 69 | 65 73 2c 20 69 74 20 69 |r indici|es, it i|
|00001410| 73 0d 73 74 72 6f 6e 67 | 6c 79 20 72 65 63 6f 6d |s.strong|ly recom|
|00001420| 6d 65 6e 64 65 64 20 74 | 68 61 74 20 79 6f 75 20 |mended t|hat you |
|00001430| 75 73 65 20 64 65 73 63 | 72 69 70 74 69 76 65 20 |use desc|riptive |
|00001440| 73 74 72 69 6e 67 73 20 | 75 6e 6c 65 73 73 20 79 |strings |unless y|
|00001450| 6f 75 20 61 72 65 0d 70 | 6c 61 6e 6e 69 6e 67 20 |ou are.p|lanning |
|00001460| 6f 6e 20 75 73 69 6e 67 | 20 74 68 61 74 20 70 6f |on using| that po|
|00001470| 77 65 72 2e 0d 5c 69 6e | 64 65 78 7b 6c 69 73 74 |wer..\in|dex{list|
|00001480| 21 63 72 65 61 74 69 6f | 6e 7c 29 7d 0d 0d 5c 73 |!creatio|n|)}..\s|
|00001490| 65 63 74 69 6f 6e 7b 4c | 69 73 74 20 49 6e 64 65 |ection{L|ist Inde|
|000014a0| 78 69 6e 67 7d 0d 5c 69 | 6e 64 65 78 7b 6c 69 73 |xing}.\i|ndex{lis|
|000014b0| 74 21 69 6e 64 65 78 69 | 6e 67 7c 28 7d 0d 54 6f |t!indexi|ng|(}.To|
|000014c0| 20 72 65 66 65 72 65 6e | 63 65 20 61 20 6c 69 73 | referen|ce a lis|
|000014d0| 74 20 6d 65 6d 62 65 72 | 2c 20 74 77 6f 20 6d 65 |t member|, two me|
|000014e0| 74 68 6f 64 73 20 61 72 | 65 20 61 76 61 69 6c 61 |thods ar|e availa|
|000014f0| 62 6c 65 2e 20 20 42 6f | 74 68 20 61 72 65 20 61 |ble. Bo|th are a|
|00001500| 20 6c 6f 74 0d 6c 69 6b | 65 20 74 68 65 20 69 6d | lot.lik|e the im|
|00001510| 70 6c 69 63 69 74 20 6c | 69 73 74 20 63 72 65 61 |plicit l|ist crea|
|00001520| 74 69 6f 6e 2c 20 6a 75 | 73 74 20 77 69 74 68 6f |tion, ju|st witho|
|00001530| 75 74 20 74 68 65 20 65 | 71 75 61 6c 73 20 73 69 |ut the e|quals si|
|00001540| 67 6e 20 61 6e 64 0d 72 | 69 67 68 74 20 68 61 6e |gn and.r|ight han|
|00001550| 64 20 73 69 64 65 2e 20 | 0d 0d 54 68 65 20 66 69 |d side. |..The fi|
|00001560| 72 73 74 20 6d 65 74 68 | 6f 64 20 69 73 20 6f 66 |rst meth|od is of|
|00001570| 20 74 68 65 20 66 6f 72 | 6d 20 7b 5c 69 74 20 6c | the for|m {\it l|
|00001580| 69 73 74 6e 61 6d 65 5c | 76 65 72 62 2b 2e 2b 69 |istname\|verb+.+i|
|00001590| 6e 64 65 78 7d 20 2e 20 | 20 49 74 0d 69 6e 74 65 |ndex} . | It.inte|
|000015a0| 72 70 72 65 74 73 20 7b | 5c 69 74 20 69 6e 64 65 |rprets {|\it inde|
|000015b0| 78 7d 20 61 73 20 61 20 | 63 68 61 72 61 63 74 65 |x} as a |characte|
|000015c0| 72 20 73 74 72 69 6e 67 | 2c 20 61 6e 64 20 75 73 |r string|, and us|
|000015d0| 65 73 20 74 68 61 74 20 | 73 74 72 69 6e 67 20 61 |es that |string a|
|000015e0| 73 0d 61 6e 20 69 6e 64 | 65 78 20 74 6f 20 74 68 |s.an ind|ex to th|
|000015f0| 65 20 6c 69 73 74 20 73 | 70 65 63 69 66 69 65 73 |e list s|pecifies|
|00001600| 20 62 79 20 7b 5c 69 74 | 20 6c 69 73 74 6e 61 6d | by {\it| listnam|
|00001610| 65 7d 2e 0d 0d 54 68 65 | 20 73 65 63 6f 6e 64 20 |e}...The| second |
|00001620| 6d 65 74 68 6f 64 20 75 | 73 65 73 20 74 68 65 20 |method u|ses the |
|00001630| 73 71 75 61 72 65 20 62 | 72 61 63 65 73 2c 20 5c |square b|races, \|
|00001640| 76 65 72 62 2b 5b 2b 20 | 61 6e 64 20 5c 76 65 72 |verb+[+ |and \ver|
|00001650| 62 2b 5d 2b 2c 20 61 6e | 64 0d 66 6f 72 63 65 73 |b+]+, an|d.forces|
|00001660| 20 65 76 61 6c 75 61 74 | 69 6f 6e 20 6f 66 20 74 | evaluat|ion of t|
|00001670| 68 65 20 63 6f 6e 74 65 | 6e 74 73 20 6f 66 20 74 |he conte|nts of t|
|00001680| 68 65 20 62 72 61 63 65 | 73 20 61 73 20 61 20 73 |he brace|s as a s|
|00001690| 74 72 69 6e 67 2c 20 61 | 6e 64 20 74 68 65 6e 0d |tring, a|nd then.|
|000016a0| 75 73 65 73 20 74 68 65 | 20 72 65 73 75 6c 74 69 |uses the| resulti|
|000016b0| 6e 67 20 73 74 72 69 6e | 67 20 61 73 20 61 6e 20 |ng strin|g as an |
|000016c0| 69 6e 64 65 78 20 74 6f | 20 74 68 65 20 6c 69 73 |index to| the lis|
|000016d0| 74 2e 20 20 54 68 65 20 | 65 78 70 72 65 73 73 69 |t. The |expressi|
|000016e0| 6f 6e 0d 69 6e 73 69 64 | 65 20 74 68 65 20 62 72 |on.insid|e the br|
|000016f0| 61 63 65 73 20 6d 75 73 | 74 20 65 76 61 6c 75 61 |aces mus|t evalua|
|00001700| 74 65 20 74 6f 20 61 20 | 73 63 61 6c 61 72 20 6f |te to a |scalar o|
|00001710| 72 20 73 74 72 69 6e 67 | 2e 20 20 54 68 69 73 20 |r string|. This |
|00001720| 6d 65 74 68 6f 64 20 69 | 73 0d 72 65 71 75 69 72 |method i|s.requir|
|00001730| 65 64 20 69 66 20 79 6f | 75 20 75 73 65 64 20 74 |ed if yo|u used t|
|00001740| 68 65 20 65 78 70 6c 69 | 63 69 74 20 63 72 65 61 |he expli|cit crea|
|00001750| 74 69 6f 6e 20 6d 65 74 | 68 6f 64 2c 20 61 6e 64 |tion met|hod, and|
|00001760| 20 64 69 64 20 6e 6f 74 | 20 61 73 73 69 67 6e 0d | did not| assign.|
|00001770| 69 6e 64 69 63 69 65 73 | 2e 0d 0d 5c 62 65 67 69 |indicies|...\begi|
|00001780| 6e 7b 76 65 72 62 61 74 | 69 6d 7d 0d 3e 20 2f 2f |n{verbat|im}.> //|
|00001790| 20 73 6f 6d 65 20 65 71 | 75 69 76 61 6c 65 6e 74 | some eq|uivalent|
|000017a0| 20 6d 65 74 68 6f 64 73 | 20 6f 66 20 67 65 74 74 | methods| of gett|
|000017b0| 69 6e 67 20 74 68 65 20 | 66 69 72 73 74 20 65 6c |ing the |first el|
|000017c0| 65 6d 65 6e 74 0d 3e 20 | 6d 79 6c 69 73 74 2e 5b |ement.> |mylist.[|
|000017d0| 35 5d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |5] | |
|000017e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000017f0| 20 20 0d 20 35 20 3d 0d | 20 20 20 20 20 20 20 20 | . 5 =.| |
|00001800| 34 20 20 20 20 20 20 20 | 20 34 2e 35 20 20 20 20 |4 | 4.5 |
|00001810| 20 20 20 20 20 20 35 20 | 20 20 20 20 20 20 20 35 | 5 | 5|
|00001820| 2e 35 20 20 20 20 20 20 | 20 20 20 20 36 20 20 0d |.5 | 6 .|
|00001830| 3e 20 65 3d 35 20 20 20 | 20 20 20 20 20 20 20 20 |> e=5 | |
|00001840| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001850| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001860| 20 20 0d 20 65 20 3d 0d | 20 20 20 20 20 20 20 20 | . e =.| |
|00001870| 35 0d 3e 20 6d 79 6c 69 | 73 74 2e 5b 65 5d 0d 20 |5.> myli|st.[e]. |
|00001880| 35 20 3d 0d 20 20 20 20 | 20 20 20 20 34 20 20 20 |5 =. | 4 |
|00001890| 20 20 20 20 20 34 2e 35 | 20 20 20 20 20 20 20 20 | 4.5| |
|000018a0| 20 20 35 20 20 20 20 20 | 20 20 20 35 2e 35 20 20 | 5 | 5.5 |
|000018b0| 20 20 20 20 20 20 20 20 | 36 20 20 0d 3e 20 6d 79 | |6 .> my|
|000018c0| 6c 69 73 74 2e 5b 32 2b | 73 71 72 74 28 39 29 5d |list.[2+|sqrt(9)]|
|000018d0| 0d 20 35 20 3d 0d 20 20 | 20 20 20 20 20 20 34 20 |. 5 =. | 4 |
|000018e0| 20 20 20 20 20 20 20 34 | 2e 35 20 20 20 20 20 20 | 4|.5 |
|000018f0| 20 20 20 20 35 20 20 20 | 20 20 20 20 20 35 2e 35 | 5 | 5.5|
|00001900| 20 20 20 20 20 20 20 20 | 20 20 36 20 0d 3e 20 2f | | 6 .> /|
|00001910| 2f 20 73 6f 6d 65 20 6d | 6f 72 65 20 65 71 75 69 |/ some m|ore equi|
|00001920| 76 61 6c 65 6e 74 73 0d | 3e 20 6d 79 6c 69 73 74 |valents.|> mylist|
|00001930| 2e 73 74 72 69 6e 67 76 | 61 6c 0d 6f 6e 65 20 70 |.stringv|al.one p|
|00001940| 6f 69 6e 74 20 66 6f 75 | 72 20 74 77 6f 0d 3e 20 |oint fou|r two.> |
|00001950| 6d 79 6c 69 73 74 2e 5b | 22 73 74 72 69 6e 67 76 |mylist.[|"stringv|
|00001960| 61 6c 22 5d 0d 6f 6e 65 | 20 70 6f 69 6e 74 20 66 |al"].one| point f|
|00001970| 6f 75 72 20 74 77 6f 0d | 3e 20 6d 79 6c 69 73 74 |our two.|> mylist|
|00001980| 2e 5b 22 73 74 72 69 22 | 20 2b 20 22 6e 67 76 61 |.["stri"| + "ngva|
|00001990| 6c 22 5d 0d 6f 6e 65 20 | 70 6f 69 6e 74 20 66 6f |l"].one |point fo|
|000019a0| 75 72 20 74 77 6f 0d 5c | 65 6e 64 7b 76 65 72 62 |ur two.\|end{verb|
|000019b0| 61 74 69 6d 7d 0d 0d 0d | 5c 73 75 62 73 65 63 74 |atim}...|\subsect|
|000019c0| 69 6f 6e 7b 46 75 6e 63 | 74 69 6f 6e 73 20 72 65 |ion{Func|tions re|
|000019d0| 74 75 72 6e 69 6e 67 20 | 6c 69 73 74 73 7d 0d 0d |turning |lists}..|
|000019e0| 57 65 20 68 61 76 65 20 | 61 6c 72 65 61 64 79 20 |We have |already |
|000019f0| 61 6c 6c 75 64 65 64 20 | 74 6f 20 74 68 65 20 66 |alluded |to the f|
|00001a00| 61 63 74 20 74 68 61 74 | 20 73 6f 6d 65 20 66 75 |act that| some fu|
|00001a10| 6e 63 74 69 6f 6e 73 20 | 72 65 74 75 72 6e 20 6c |nctions |return l|
|00001a20| 69 73 74 73 2e 0d 54 68 | 69 73 20 69 73 20 6d 6f |ists..Th|is is mo|
|00001a30| 73 74 20 63 6f 6d 6d 6f | 6e 20 77 68 65 6e 20 74 |st commo|n when t|
|00001a40| 68 65 20 72 65 74 75 72 | 6e 20 76 61 6c 75 65 20 |he retur|n value |
|00001a50| 69 73 20 6d 61 64 65 20 | 75 70 20 6f 66 20 64 69 |is made |up of di|
|00001a60| 66 66 65 72 65 6e 74 0d | 74 79 70 65 73 2c 20 6f |fferent.|types, o|
|00001a70| 72 20 69 73 20 6d 61 64 | 65 20 75 70 20 6f 66 20 |r is mad|e up of |
|00001a80| 6d 61 74 72 69 63 65 73 | 20 77 69 74 68 20 64 69 |matrices| with di|
|00001a90| 66 66 65 72 65 6e 74 20 | 64 69 6d 65 6e 73 69 6f |fferent |dimensio|
|00001aa0| 6e 73 2e 20 20 41 6e 0d | 65 78 61 6d 70 6c 65 20 |ns. An.|example |
|00001ab0| 69 73 20 74 68 65 20 5c | 76 65 72 62 2b 65 69 67 |is the \|verb+eig|
|00001ac0| 2b 20 66 75 6e 63 74 69 | 6f 6e 2c 20 77 68 69 63 |+ functi|on, whic|
|00001ad0| 68 20 72 65 74 75 72 6e | 73 20 61 20 6c 69 73 74 |h return|s a list|
|00001ae0| 20 63 6f 6e 74 61 69 6e | 69 6e 67 0d 74 77 6f 20 | contain|ing.two |
|00001af0| 6d 61 74 72 69 63 69 65 | 73 2c 20 61 73 20 73 68 |matricie|s, as sh|
|00001b00| 6f 77 6e 20 68 65 72 65 | 3a 0d 5c 62 65 67 69 6e |own here|:.\begin|
|00001b10| 7b 76 65 72 62 61 74 69 | 6d 7d 0d 3e 20 61 3d 20 |{verbati|m}.> a= |
|00001b20| 72 61 6e 64 28 34 2c 34 | 29 0d 20 61 20 3d 0d 20 |rand(4,4|). a =. |
|00001b30| 20 20 20 30 2e 36 36 35 | 20 20 20 20 20 20 30 2e | 0.665| 0.|
|00001b40| 36 35 35 20 20 20 20 20 | 20 30 2e 32 39 39 20 20 |655 | 0.299 |
|00001b50| 20 20 20 30 2e 30 39 31 | 38 20 20 0d 20 20 20 30 | 0.091|8 . 0|
|00001b60| 2e 30 38 34 37 20 20 20 | 20 20 20 30 2e 31 32 39 |.0847 | 0.129|
|00001b70| 20 20 20 20 20 20 30 2e | 32 36 35 20 20 20 20 20 | 0.|265 |
|00001b80| 20 30 2e 39 30 32 20 20 | 0d 20 20 20 20 30 2e 32 | 0.902 |. 0.2|
|00001b90| 30 34 20 20 20 20 20 20 | 20 30 2e 39 31 20 20 20 |04 | 0.91 |
|00001ba0| 20 20 20 20 20 30 2e 37 | 20 20 20 20 20 20 20 30 | 0.7| 0|
|00001bb0| 2e 39 36 20 20 0d 20 20 | 20 20 30 2e 31 36 37 20 |.96 . | 0.167 |
|00001bc0| 20 20 20 20 20 30 2e 31 | 31 32 20 20 20 20 20 20 | 0.1|12 |
|00001bd0| 20 30 2e 39 35 20 20 20 | 20 20 20 30 2e 39 31 35 | 0.95 | 0.915|
|00001be0| 20 20 0d 3e 20 61 5f 65 | 69 67 20 3d 20 65 69 67 | .> a_e|ig = eig|
|00001bf0| 28 61 29 0d 20 20 20 76 | 61 6c 20 20 20 20 20 20 |(a). v|al |
|00001c00| 20 20 20 20 76 65 63 20 | 20 20 20 20 20 20 20 20 | vec | |
|00001c10| 20 0d 3e 20 73 68 6f 77 | 28 61 5f 65 69 67 2e 76 | .> show|(a_eig.v|
|00001c20| 61 6c 29 0d 20 20 20 6e | 61 6d 65 3a 20 20 20 20 |al). n|ame: |
|00001c30| 20 20 76 61 6c 20 20 20 | 20 20 20 0d 20 20 20 63 | val | . c|
|00001c40| 6c 61 73 73 3a 20 20 20 | 20 20 6e 75 6d 20 20 20 |lass: | num |
|00001c50| 20 20 20 0d 20 20 20 74 | 79 70 65 3a 20 20 20 20 | . t|ype: |
|00001c60| 20 20 63 6f 6d 70 6c 65 | 78 20 20 0d 20 20 20 20 | comple|x . |
|00001c70| 20 6e 72 3a 20 20 20 20 | 20 20 31 20 20 20 20 20 | nr: | 1 |
|00001c80| 20 20 20 0d 20 20 20 20 | 20 6e 63 3a 20 20 20 20 | . | nc: |
|00001c90| 20 20 34 20 20 20 20 20 | 20 20 20 0d 3e 20 73 68 | 4 | .> sh|
|00001ca0| 6f 77 28 61 5f 65 69 67 | 2e 76 65 63 29 0d 20 20 |ow(a_eig|.vec). |
|00001cb0| 20 6e 61 6d 65 3a 20 20 | 20 20 20 20 76 65 63 20 | name: | vec |
|00001cc0| 20 20 20 20 20 0d 20 20 | 20 63 6c 61 73 73 3a 20 | . | class: |
|00001cd0| 20 20 20 20 6e 75 6d 20 | 20 20 20 20 20 0d 20 20 | num | . |
|00001ce0| 20 74 79 70 65 3a 20 20 | 20 20 20 20 63 6f 6d 70 | type: | comp|
|00001cf0| 6c 65 78 20 20 0d 20 20 | 20 20 20 6e 72 3a 20 20 |lex . | nr: |
|00001d00| 20 20 20 20 34 20 20 20 | 20 20 20 20 20 0d 20 20 | 4 | . |
|00001d10| 20 20 20 6e 63 3a 20 20 | 20 20 20 20 34 20 20 20 | nc: | 4 |
|00001d20| 20 20 20 20 20 0d 5c 65 | 6e 64 7b 76 65 72 62 61 | .\e|nd{verba|
|00001d30| 74 69 6d 7d 0d 0d 48 6f | 77 65 76 65 72 20 73 6f |tim}..Ho|wever so|
|00001d40| 6d 65 74 69 6d 65 73 20 | 79 6f 75 20 64 6f 6e 27 |metimes |you don'|
|00001d50| 74 20 77 61 6e 74 20 61 | 6c 6c 20 74 68 65 20 69 |t want a|ll the i|
|00001d60| 6e 66 6f 72 6d 61 74 69 | 6f 6e 2e 20 20 46 6f 72 |nformati|on. For|
|00001d70| 20 69 6e 73 74 61 6e 63 | 65 2c 0d 77 65 20 6d 69 | instanc|e,.we mi|
|00001d80| 67 68 74 20 77 61 6e 74 | 20 74 6f 20 63 6f 6e 64 |ght want| to cond|
|00001d90| 75 63 74 20 61 20 74 65 | 73 74 20 6f 6e 20 74 68 |uct a te|st on th|
|00001da0| 65 20 65 69 67 65 6e 76 | 61 6c 75 65 73 2e 20 20 |e eigenv|alues. |
|00001db0| 53 6f 20 77 65 20 63 61 | 6e 20 74 68 72 6f 77 0d |So we ca|n throw.|
|00001dc0| 61 77 61 79 20 74 68 65 | 20 65 69 67 65 6e 76 65 |away the| eigenve|
|00001dd0| 63 74 6f 72 73 2c 20 61 | 6e 64 20 6a 75 73 74 20 |ctors, a|nd just |
|00001de0| 6c 6f 6f 6b 20 61 74 20 | 74 68 65 20 65 69 67 65 |look at |the eige|
|00001df0| 6e 76 61 6c 75 65 73 2e | 20 20 57 65 20 63 61 6e |nvalues.| We can|
|00001e00| 20 64 6f 0d 74 68 69 73 | 20 75 73 69 6e 67 20 65 | do.this| using e|
|00001e10| 69 74 68 65 72 20 6d 65 | 74 68 6f 64 2c 20 61 73 |ither me|thod, as|
|00001e20| 20 73 68 6f 77 6e 20 68 | 65 72 65 3a 0d 5c 62 65 | shown h|ere:.\be|
|00001e30| 67 69 6e 7b 76 65 72 62 | 61 74 69 6d 7d 0d 3e 20 |gin{verb|atim}.> |
|00001e40| 65 69 67 65 6e 76 61 6c | 75 65 73 31 20 3d 20 65 |eigenval|ues1 = e|
|00001e50| 69 67 28 61 29 2e 76 61 | 6c 20 20 20 0d 20 65 69 |ig(a).va|l . ei|
|00001e60| 67 65 6e 76 61 6c 75 65 | 73 31 20 3d 0d 20 6d 61 |genvalue|s1 =. ma|
|00001e70| 74 72 69 78 20 63 6f 6c | 75 6d 6e 73 20 31 20 74 |trix col|umns 1 t|
|00001e80| 68 72 75 20 33 0d 20 20 | 20 20 20 20 20 20 20 20 |hru 3. | |
|00001e90| 20 20 20 20 30 2e 35 35 | 34 20 2b 20 30 69 20 20 | 0.55|4 + 0i |
|00001ea0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 32 2e 31 | | 2.1|
|00001eb0| 35 20 2b 20 30 69 20 20 | 20 20 20 20 20 20 20 2d |5 + 0i | -|
|00001ec0| 30 2e 31 34 38 20 2b 20 | 30 2e 34 35 37 69 0d 0d |0.148 + |0.457i..|
|00001ed0| 20 6d 61 74 72 69 78 20 | 63 6f 6c 75 6d 6e 73 20 | matrix |columns |
|00001ee0| 34 20 74 68 72 75 20 34 | 0d 20 20 20 20 20 20 20 |4 thru 4|. |
|00001ef0| 20 20 2d 30 2e 31 34 38 | 20 2d 20 30 2e 34 35 37 | -0.148| - 0.457|
|00001f00| 69 0d 3e 20 65 69 67 65 | 6e 76 61 6c 75 65 73 32 |i.> eige|nvalues2|
|00001f10| 20 3d 20 65 69 67 28 61 | 29 2e 5b 22 76 61 6c 22 | = eig(a|).["val"|
|00001f20| 5d 0d 20 65 69 67 65 6e | 76 61 6c 75 65 73 32 20 |]. eigen|values2 |
|00001f30| 3d 0d 20 6d 61 74 72 69 | 78 20 63 6f 6c 75 6d 6e |=. matri|x column|
|00001f40| 73 20 31 20 74 68 72 75 | 20 33 0d 20 20 20 20 20 |s 1 thru| 3. |
|00001f50| 20 20 20 20 20 20 20 20 | 20 30 2e 35 35 34 20 2b | | 0.554 +|
|00001f60| 20 30 69 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | 0i | |
|00001f70| 20 20 32 2e 31 35 20 2b | 20 30 69 20 20 20 20 20 | 2.15 +| 0i |
|00001f80| 20 20 20 20 2d 30 2e 31 | 34 38 20 2b 20 30 2e 34 | -0.1|48 + 0.4|
|00001f90| 35 37 69 0d 0d 20 6d 61 | 74 72 69 78 20 63 6f 6c |57i.. ma|trix col|
|00001fa0| 75 6d 6e 73 20 34 20 74 | 68 72 75 20 34 0d 20 20 |umns 4 t|hru 4. |
|00001fb0| 20 20 20 20 20 20 20 2d | 30 2e 31 34 38 20 2d 20 | -|0.148 - |
|00001fc0| 30 2e 34 35 37 69 0d 5c | 65 6e 64 7b 76 65 72 62 |0.457i.\|end{verb|
|00001fd0| 61 74 69 6d 7d 0d 0d 54 | 68 69 73 20 63 61 6e 20 |atim}..T|his can |
|00001fe0| 62 65 20 61 70 70 6c 69 | 65 64 20 74 6f 20 61 6e |be appli|ed to an|
|00001ff0| 79 20 66 75 6e 63 74 69 | 6f 6e 20 74 68 61 74 20 |y functi|on that |
|00002000| 65 76 61 6c 75 61 74 65 | 73 20 74 6f 20 61 20 6c |evaluate|s to a l|
|00002010| 69 73 74 20 74 79 70 65 | 2e 0d 5c 69 6e 64 65 78 |ist type|..\index|
|00002020| 7b 6c 69 73 74 21 69 6e | 64 65 78 69 6e 67 7c 29 |{list!in|dexing|)|
|00002030| 7d 0d 0d 5c 73 65 63 74 | 69 6f 6e 7b 47 6c 6f 62 |}..\sect|ion{Glob|
|00002040| 61 6c 20 53 79 6d 62 6f | 6c 20 54 61 62 6c 65 7d |al Symbo|l Table}|
|00002050| 0d 5c 69 6e 64 65 78 7b | 67 6c 6f 62 61 6c 20 73 |.\index{|global s|
|00002060| 79 6d 62 6f 6c 20 74 61 | 62 6c 65 7d 0d 0d 54 68 |ymbol ta|ble}..Th|
|00002070| 65 20 5c 52 4c 61 42 5c | 20 73 79 6d 62 6f 6c 20 |e \RLaB\| symbol |
|00002080| 74 61 62 6c 65 20 69 73 | 20 6a 75 73 74 20 61 20 |table is| just a |
|00002090| 6c 69 73 74 2e 20 49 74 | 20 63 61 6e 20 62 65 20 |list. It| can be |
|000020a0| 72 65 66 65 72 65 6e 63 | 65 64 20 77 69 74 68 20 |referenc|ed with |
|000020b0| 74 68 65 0d 73 70 65 63 | 69 61 6c 20 73 79 6d 62 |the.spec|ial symb|
|000020c0| 6f 6c 20 5c 76 65 72 62 | 2b 24 24 2b 20 2e 20 54 |ol \verb|+$$+ . T|
|000020d0| 68 65 20 73 79 6d 62 6f | 6c 2d 74 61 62 6c 65 20 |he symbo|l-table |
|000020e0| 63 61 6e 20 62 65 20 75 | 73 65 64 20 6c 69 6b 65 |can be u|sed like|
|000020f0| 20 6f 74 68 65 72 20 6c | 69 73 74 73 2c 0d 77 69 | other l|ists,.wi|
|00002100| 74 68 20 63 65 72 74 61 | 69 6e 20 65 78 63 65 70 |th certa|in excep|
|00002110| 74 69 6f 6e 73 2e 0d 5c | 62 65 67 69 6e 7b 69 74 |tions..\|begin{it|
|00002120| 65 6d 69 7a 65 7d 0d 20 | 20 5c 69 74 65 6d 20 20 |emize}. | \item |
|00002130| 54 68 65 20 67 6c 6f 62 | 61 6c 20 73 79 6d 62 6f |The glob|al symbo|
|00002140| 6c 20 74 61 62 6c 65 20 | 63 61 6e 6e 6f 74 20 62 |l table |cannot b|
|00002150| 65 20 63 6f 70 69 65 64 | 2e 0d 20 20 5c 69 74 65 |e copied|.. \ite|
|00002160| 6d 20 20 54 68 65 20 67 | 6c 6f 62 61 6c 20 73 79 |m The g|lobal sy|
|00002170| 6d 62 6f 6c 20 74 61 62 | 6c 65 20 63 61 6e 6e 6f |mbol tab|le canno|
|00002180| 74 20 62 65 20 64 65 73 | 74 72 6f 79 65 64 2e 0d |t be des|troyed..|
|00002190| 5c 65 6e 64 7b 69 74 65 | 6d 69 7a 65 7d 0d 0d 0d |\end{ite|mize}...|
|000021a0| 57 68 79 20 77 6f 75 6c | 64 20 79 6f 75 20 77 61 |Why woul|d you wa|
|000021b0| 6e 74 20 74 6f 20 75 73 | 65 20 5c 76 65 72 62 2b |nt to us|e \verb+|
|000021c0| 24 24 2b 20 3f 20 57 65 | 6c 6c 2c 20 79 6f 75 20 |$$+ ? We|ll, you |
|000021d0| 6d 69 67 68 74 20 75 73 | 65 20 69 74 20 74 6f 20 |might us|e it to |
|000021e0| 72 65 66 65 72 65 6e 63 | 65 20 61 0d 76 61 72 69 |referenc|e a.vari|
|000021f0| 61 62 6c 65 20 77 69 74 | 68 20 61 20 73 74 72 69 |able wit|h a stri|
|00002200| 6e 67 2e 20 46 6f 72 20 | 65 78 61 6d 70 6c 65 3a |ng. For |example:|
|00002210| 0d 0d 5c 62 65 67 69 6e | 7b 76 65 72 62 61 74 69 |..\begin|{verbati|
|00002220| 6d 7d 0d 3e 20 70 72 69 | 6e 74 66 20 28 22 45 6e |m}.> pri|ntf ("En|
|00002230| 74 65 72 20 76 61 72 69 | 61 62 6c 65 20 6e 61 6d |ter vari|able nam|
|00002240| 65 20 74 6f 20 64 69 73 | 70 6c 61 79 3a 20 22 29 |e to dis|play: ")|
|00002250| 3b 20 61 3d 20 67 65 74 | 6c 69 6e 65 28 22 73 74 |; a= get|line("st|
|00002260| 64 69 6e 22 29 3b 0d 45 | 6e 74 65 72 20 76 61 72 |din");.E|nter var|
|00002270| 69 61 62 6c 65 20 6e 61 | 6d 65 20 74 6f 20 64 69 |iable na|me to di|
|00002280| 73 70 6c 61 79 3a 20 65 | 70 73 0d 3e 20 24 24 2e |splay: e|ps.> $$.|
|00002290| 5b 61 2e 5b 31 5d 5d 0d | 20 65 70 73 20 3d 0d 20 |[a.[1]].| eps =. |
|000022a0| 31 2e 31 31 65 2d 31 36 | 0d 5c 65 6e 64 7b 76 65 |1.11e-16|.\end{ve|
|000022b0| 72 62 61 74 69 6d 7d 0d | 0d 41 6e 6f 74 68 65 72 |rbatim}.|.Another|
|000022c0| 20 75 73 65 20 6d 69 67 | 68 74 20 62 65 20 74 6f | use mig|ht be to|
|000022d0| 20 6c 69 73 74 20 74 68 | 65 20 63 6f 6e 74 65 6e | list th|e conten|
|000022e0| 74 73 20 6f 66 20 74 68 | 65 20 76 61 72 69 61 62 |ts of th|e variab|
|000022f0| 6c 65 73 20 74 68 61 74 | 20 61 72 65 0d 64 65 66 |les that| are.def|
|00002300| 69 6e 65 64 2e 0d 5c 62 | 65 67 69 6e 7b 76 65 72 |ined..\b|egin{ver|
|00002310| 62 61 74 69 6d 7d 0d 3e | 20 20 66 6f 72 20 28 69 |batim}.>| for (i|
|00002320| 20 69 6e 20 6d 65 6d 62 | 65 72 73 28 24 24 29 29 | in memb|ers($$))|
|00002330| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 0d 20 | | . |
|00002340| 20 20 20 7b 20 20 20 20 | 20 20 20 20 20 20 20 20 | { | |
|00002350| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002360| 20 20 20 20 20 20 20 0d | 20 20 20 20 20 20 69 66 | .| if|
|00002370| 20 28 63 6c 61 73 73 20 | 28 24 24 2e 5b 69 5d 29 | (class |($$.[i])|
|00002380| 20 21 3d 20 22 66 75 6e | 63 74 69 6f 6e 22 29 20 | != "fun|ction") |
|00002390| 0d 20 20 20 20 20 20 7b | 20 20 20 20 20 20 20 20 |. {| |
|000023a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000023b0| 20 20 20 20 20 20 20 20 | 20 0d 20 20 20 20 20 20 | | . |
|000023c0| 20 20 24 24 2e 5b 69 5d | 20 3f 20 20 20 20 20 20 | $$.[i]| ? |
|000023d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000023e0| 20 20 0d 20 20 20 20 20 | 20 7d 20 20 20 20 20 20 | . | } |
|000023f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002400| 20 20 20 20 20 20 20 20 | 20 20 20 0d 20 20 20 20 | | . |
|00002410| 7d 20 20 20 20 20 20 20 | 20 20 0d 20 65 69 67 65 |} | . eige|
|00002420| 6e 76 61 6c 75 65 73 31 | 20 3d 0d 20 6d 61 74 72 |nvalues1| =. matr|
|00002430| 69 78 20 63 6f 6c 75 6d | 6e 73 20 31 20 74 68 72 |ix colum|ns 1 thr|
|00002440| 75 20 33 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |u 3. | |
|00002450| 20 20 30 2e 35 35 34 20 | 2b 20 30 69 20 20 20 20 | 0.554 |+ 0i |
|00002460| 20 20 20 20 20 20 20 20 | 20 20 20 32 2e 31 35 20 | | 2.15 |
|00002470| 2b 20 30 69 20 20 20 20 | 20 20 20 20 20 2d 30 2e |+ 0i | -0.|
|00002480| 31 34 38 20 2b 20 30 2e | 34 35 37 69 0d 0d 20 6d |148 + 0.|457i.. m|
|00002490| 61 74 72 69 78 20 63 6f | 6c 75 6d 6e 73 20 34 20 |atrix co|lumns 4 |
|000024a0| 74 68 72 75 20 34 0d 20 | 20 20 20 20 20 20 20 20 |thru 4. | |
|000024b0| 2d 30 2e 31 34 38 20 2d | 20 30 2e 34 35 37 69 0d |-0.148 -| 0.457i.|
|000024c0| 20 65 69 67 65 6e 76 61 | 6c 75 65 73 32 20 3d 0d | eigenva|lues2 =.|
|000024d0| 20 6d 61 74 72 69 78 20 | 63 6f 6c 75 6d 6e 73 20 | matrix |columns |
|000024e0| 31 20 74 68 72 75 20 33 | 0d 20 20 20 20 20 20 20 |1 thru 3|. |
|000024f0| 20 20 20 20 20 20 20 30 | 2e 35 35 34 20 2b 20 30 | 0|.554 + 0|
|00002500| 69 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |i | |
|00002510| 32 2e 31 35 20 2b 20 30 | 69 20 20 20 20 20 20 20 |2.15 + 0|i |
|00002520| 20 20 2d 30 2e 31 34 38 | 20 2b 20 30 2e 34 35 37 | -0.148| + 0.457|
|00002530| 69 0d 0d 20 6d 61 74 72 | 69 78 20 63 6f 6c 75 6d |i.. matr|ix colum|
|00002540| 6e 73 20 34 20 74 68 72 | 75 20 34 0d 20 20 20 20 |ns 4 thr|u 4. |
|00002550| 20 20 20 20 20 2d 30 2e | 31 34 38 20 2d 20 30 2e | -0.|148 - 0.|
|00002560| 34 35 37 69 0d 20 65 70 | 73 20 3d 0d 20 31 2e 31 |457i. ep|s =. 1.1|
|00002570| 31 65 2d 31 36 0d 20 70 | 69 20 3d 0d 20 20 20 20 |1e-16. p|i =. |
|00002580| 20 33 2e 31 34 0d 5c 65 | 6e 64 7b 76 65 72 62 61 | 3.14.\e|nd{verba|
|00002590| 74 69 6d 7d 0d 0d 0d 5c | 69 6e 64 65 78 7b 6c 69 |tim}...\|index{li|
|000025a0| 73 74 7c 29 7d 0d 0d 0d | 0d 0d |st|)}...|.. |
+--------+-------------------------+-------------------------+--------+--------+